<template>
  <el-dialog
    :title="dialogTitle"
    width="1250px"
    :visible="dialogVisible"
    @close='closeDialog(false)'
  >
    <el-editable
      class="editables"
      :columns="cardColumns"
      :data="dialogList"
    >
      <template
        slot="default-registrationNumber"
        slot-scope="scope">
        <div>
          <cell-registration
            :key="scope.row.registrationNumber"
            :regis-no="scope.row.registrationNumber"
            :content="'注册证已过期，点击查看详细信息'"
            :status="scope.row.isNoExpire"
            :regis-data="scope.row.registrationInfo"
          />
        </div>
        <!-- <el-button
          :disabled="!scope.row.registrationNumber||!scope.row.registrationId"
          v-html="regisNoButton(scope.row)"
          @click="showPdfRegistion(scope.row.registrationId)"
          type="text"
        /> -->
      </template>
    </el-editable>

    <div class="dialog-info">
      <el-editable
        class="editables"
        :columns="cardColumnsInfo"
        :data="dialogListInfo"
        height='400'
      />
      <el-pagination
        align="right"
        style="margin-top:20px;"
        @size-change="sizeChange"
        @current-change="pageChange"
        :page-sizes="page.PAGE_NUMBER"
        :page-size="page.size"
        :current-page="page.page"
        :layout="page.PAGINATION_LAYOUT"
        :total="dialogTotal"
      />
    </div>
  </el-dialog>
</template>
<script>
import ElEditable from '@components/el-editable'
import { PAGE_NUMBER, PAGINATION_LAYOUT } from '@const/common'
import paginationMixin from '@mixins/paginationMixin.js'
import { getCertificate } from '@const/productCenterApiV2'
import { hasIn } from 'lodash'
import { regisNoButton, showPdfRegistion } from '@const/agencySaas'
import CellRegistration from '@/moduleComponents/common/detail/cell-registration'
export default {
  name: 'DialogInfo',
  mixins: [paginationMixin],
  data () {
    return {
      page: {
        PAGE_NUMBER,
        PAGINATION_LAYOUT
      },
      isShow: this.dialogVisible
    }
  },
  methods: {
    regisNoButton,
    showPdfRegistion,
    // 页码更改把当前页和当前页码传给父组件方法的参数
    getItems () {
      this.$emit('getInfo', this.page.page, this.page.size)
    },
    closeDialog (bool) {
      this.$emit('closeDialog', bool)
    }
  },
  props: {
    dialogTitle: {
      type: String,
      default: () => ''
    },
    dialogVisible: {
      type: Boolean,
      default: () => false
    },
    cardColumns: {
      type: Array,
      default: () => []
    },
    dialogList: {
      type: Array,
      default: () => []
    },
    cardColumnsInfo: {
      type: Array,
      default: () => []
    },
    dialogListInfo: {
      type: Array,
      default: () => []
    },
    dialogTotal: {
      type: Number,
      default: 0
    }
  },
  components: { ElEditable, CellRegistration }
}
</script>
<style lang="less">
.dialog-info {
  margin-top: 46px;
}
</style>
